<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>请假申请 - 消防工程集团</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        body {
            background: #f5f5f5;
            padding-bottom: 20px;
        }
    </style>
</head>
<body>
    <!-- Header -->
    <div class="bg-gradient-to-r from-blue-600 to-blue-700 text-white px-4 py-4 flex items-center">
        <a href="home.html" class="mr-3">
            <i class="fas fa-arrow-left text-xl"></i>
        </a>
        <h1 class="text-lg font-semibold">请假申请</h1>
    </div>

    <!-- Form -->
    <div class="bg-white mx-4 mt-4 rounded-xl shadow-sm p-4 mb-4">
        <div class="space-y-4">
            <!-- Leave Type -->
            <div>
                <label class="block text-sm font-semibold text-gray-700 mb-2">
                    <i class="fas fa-calendar-times text-blue-500 mr-1"></i>请假类型 <span class="text-red-500">*</span>
                </label>
                <div class="grid grid-cols-2 gap-3">
                    <label class="border-2 border-gray-200 rounded-lg p-3 text-center cursor-pointer hover:border-blue-500">
                        <input type="radio" name="leaveType" value="sick" class="hidden" checked>
                        <i class="fas fa-heartbeat text-red-500 text-xl mb-2"></i>
                        <div class="text-sm text-gray-700">病假</div>
                    </label>
                    <label class="border-2 border-gray-200 rounded-lg p-3 text-center cursor-pointer hover:border-blue-500">
                        <input type="radio" name="leaveType" value="personal" class="hidden">
                        <i class="fas fa-user text-blue-500 text-xl mb-2"></i>
                        <div class="text-sm text-gray-700">事假</div>
                    </label>
                    <label class="border-2 border-gray-200 rounded-lg p-3 text-center cursor-pointer hover:border-blue-500">
                        <input type="radio" name="leaveType" value="annual" class="hidden">
                        <i class="fas fa-umbrella-beach text-orange-500 text-xl mb-2"></i>
                        <div class="text-sm text-gray-700">年假</div>
                    </label>
                    <label class="border-2 border-gray-200 rounded-lg p-3 text-center cursor-pointer hover:border-blue-500">
                        <input type="radio" name="leaveType" value="overtime" class="hidden">
                        <i class="fas fa-moon text-purple-500 text-xl mb-2"></i>
                        <div class="text-sm text-gray-700">调休</div>
                    </label>
                </div>
            </div>

            <!-- Leave Date Range -->
            <div>
                <label class="block text-sm font-semibold text-gray-700 mb-2">
                    <i class="fas fa-calendar-alt text-blue-500 mr-1"></i>请假时间 <span class="text-red-500">*</span>
                </label>
                <div class="grid grid-cols-2 gap-3">
                    <div>
                        <div class="text-xs text-gray-500 mb-1">开始日期</div>
                        <input type="date" 
                               class="w-full border border-gray-300 rounded-lg px-4 py-3 text-gray-800 focus:outline-none focus:ring-2 focus:ring-blue-500">
                    </div>
                    <div>
                        <div class="text-xs text-gray-500 mb-1">结束日期</div>
                        <input type="date" 
                               class="w-full border border-gray-300 rounded-lg px-4 py-3 text-gray-800 focus:outline-none focus:ring-2 focus:ring-blue-500">
                    </div>
                </div>
            </div>

            <!-- Leave Days -->
            <div>
                <label class="block text-sm font-semibold text-gray-700 mb-2">
                    <i class="fas fa-clock text-blue-500 mr-1"></i>请假时长
                </label>
                <div class="bg-blue-50 rounded-lg p-3">
                    <div class="flex items-center justify-between">
                        <span class="text-sm text-gray-600">共请假</span>
                        <span class="text-xl font-bold text-blue-600">1</span>
                        <span class="text-sm text-gray-600">天</span>
                    </div>
                    <div class="text-xs text-gray-500 mt-2">（自动计算）</div>
                </div>
            </div>

            <!-- Reason -->
            <div>
                <label class="block text-sm font-semibold text-gray-700 mb-2">
                    <i class="fas fa-comment-alt text-blue-500 mr-1"></i>请假原因 <span class="text-red-500">*</span>
                </label>
                <textarea placeholder="请详细说明请假原因" rows="4" 
                          class="w-full border border-gray-300 rounded-lg px-4 py-3 text-gray-800 focus:outline-none focus:ring-2 focus:ring-blue-500"></textarea>
            </div>

            <!-- Emergency Contact -->
            <div>
                <label class="block text-sm font-semibold text-gray-700 mb-2">
                    <i class="fas fa-phone text-blue-500 mr-1"></i>紧急联系人
                </label>
                <input type="text" placeholder="联系人姓名" 
                       class="w-full border border-gray-300 rounded-lg px-4 py-3 text-gray-800 mb-2 focus:outline-none focus:ring-2 focus:ring-blue-500">
                <input type="tel" placeholder="联系电话" 
                       class="w-full border border-gray-300 rounded-lg px-4 py-3 text-gray-800 focus:outline-none focus:ring-2 focus:ring-blue-500">
            </div>

            <!-- Attachments (for sick leave) -->
            <div id="sickLeaveAttach" class="hidden">
                <label class="block text-sm font-semibold text-gray-700 mb-2">
                    <i class="fas fa-file-medical text-blue-500 mr-1"></i>病假证明
                </label>
                <div class="border-2 border-dashed border-gray-300 rounded-lg p-4 text-center">
                    <i class="fas fa-camera text-3xl text-gray-400 mb-2"></i>
                    <div class="text-sm text-gray-500">上传病假证明照片</div>
                    <div class="text-xs text-gray-400 mt-1">支持JPG、PNG格式</div>
                </div>
            </div>

            <!-- Project (if applicable) -->
            <div>
                <label class="block text-sm font-semibold text-gray-700 mb-2">
                    <i class="fas fa-building text-blue-500 mr-1"></i>关联项目（可选）
                </label>
                <select class="w-full border border-gray-300 rounded-lg px-4 py-3 text-gray-800 focus:outline-none focus:ring-2 focus:ring-blue-500">
                    <option value="">不关联项目</option>
                    <option value="1">消防工程A项目</option>
                    <option value="2">消防工程B项目</option>
                    <option value="3">消防工程C项目</option>
                </select>
            </div>
        </div>
    </div>

    <!-- Submit Button -->
    <div class="px-4 mb-6">
        <button class="w-full bg-gradient-to-r from-blue-600 to-blue-700 text-white py-4 rounded-xl font-semibold text-lg shadow-lg active:scale-95 transition-transform">
            <i class="fas fa-paper-plane mr-2"></i>
            提交申请
        </button>
    </div>

    <script>
        // Show/hide sick leave attachment based on leave type
        document.querySelectorAll('input[name="leaveType"]').forEach(radio => {
            radio.addEventListener('change', function() {
                const sickLeaveAttach = document.getElementById('sickLeaveAttach');
                if (this.value === 'sick') {
                    sickLeaveAttach.classList.remove('hidden');
                } else {
                    sickLeaveAttach.classList.add('hidden');
                }
            });
        });
    </script>
</body>
</html>

